﻿@inherits BasePropertyEditor

@{ 
    var date = (DateTime?)GetValueAsObject();

    if (!date.HasValue || date.Value == DateTime.MinValue)
    {
        date = DateTime.UtcNow.Date;
    }
}

<input value=@date.Value.ToString("yyyy-MM-dd")
       disabled=@IsDisabled
       @onchange=@(args => SetValueFromString((string)args.Value))
       class="form-control @(CssHelper.GetValidationClass(State))"
       placeholder=@Placeholder
       type="date" />

@foreach (var message in GetValidationMessages())
{
    <div class="invalid-feedback">
        @message
    </div>
}